import request from '@/utils/request'

// 查询退款记录列表
export function listRefund(query) {
  return request({
    url: '/order/refund/list',
    method: 'get',
    params: query
  })
}

// 查询退款记录详细
export function getRefund(id) {
  return request({
    url: '/order/refund/' + id,
    method: 'get'
  })
}


// 修改退款记录
export function updateRefund(data) {
  return request({
    url: '/order/refund',
    method: 'put',
    data: data
  })
}


// 查询退款记录详细
export function queryRefund(id) {
  return request({
    url: '/order/refund/query/' + id,
    method: 'post'
  })
}

// 审核退款记录
export function auditRefund(data) {
  return request({
    url: '/order/refund/audit',
    method: 'post',
    data: data
  })
}

// 预校验退款记录
export function preCheckRefund(type,orderId) {
  return request({
    url: '/order/refund/preCheck/' +type + "/"+ orderId,
    method: 'post'
  })
}

// 线下退款
export function manuRefund(data) {
  return request({
    url: '/order/refund/manu',
    method: 'post',
    data: data
  })
}

// 线上原路退款
export function onlineRefund(id) {
  return request({
    url: '/order/refund/refund/' + id,
    method: 'post',
  })
}
